#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{   
	int i = 0;int j = 0;
    int tmp = 0;int sum = 0;
    int m = 0; int n = 0;
	scanf("%d %d", &m, &n);

	for (i = 0; i < n; i++)
	{
		for (j = 0; j < m; j++)
		{
			scanf("%d", &tmp);
			if (tmp > 0)
			{
				sum += tmp;
			}
		}
	}

	
	printf("%d\n", sum);
	return 0;
}